home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / CommResources.h < prev    next >
C/C++ Source or Header  |  1991-04-17  |  2KB  |  88 lines

  1. /*
  2.     File:        CommResources.h
  3.  
  4.     Copyright:    © 1990 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7. */
  8.  
  9. #ifndef __COMMRESOURCES__
  10. #define __COMMRESOURCES__
  11.  
  12. #ifndef __OSUTILS__
  13. #include <OSUtils.h>
  14. #endif
  15.  
  16. /*    version of the Comm Resource Manager    */
  17. #define                curCRMVersion        2
  18.  
  19. /*    tool classes (also the tool file types)    */
  20. #define                classCM                'cbnd'
  21. #define                classFT                'fbnd'
  22. #define                classTM                'tbnd'
  23.  
  24.  
  25. /*    error codes */
  26. typedef                OSErr    CRMErr;
  27.  
  28. #define                crmGenericError        (-1)
  29. #define                crmNoErr            0
  30.  
  31. /*    crm data structures    */
  32. #define                crmType                9            /* queue type    */
  33. #define                crmRecVersion          1            /* version of queue structure */
  34.  
  35. struct CRMRec {
  36.     QElemPtr        qLink;
  37.     short            qType;
  38.     short            crmVersion;
  39.     long            crmPrivate;
  40.     short            crmReserved;
  41.  
  42.     long            crmDeviceType;
  43.     long            crmDeviceID;
  44.     long            crmAttributes;
  45.     long            crmStatus;
  46.  
  47.     long            crmRefCon;
  48. };
  49.  
  50. typedef struct CRMRec CRMRec;
  51. typedef CRMRec *CRMRecPtr;
  52.  
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif    
  56.  
  57.  
  58. pascal CRMErr     InitCRM(void);
  59. pascal QHdrPtr     CRMGetHeader(void);
  60. pascal void         CRMInstall(QElemPtr crmReqPtr);
  61. pascal OSErr     CRMRemove(QElemPtr crmReqPtr);
  62. pascal QElemPtr     CRMSearch(QElemPtr crmReqPtr);
  63. pascal short     CRMGetCRMVersion(void);
  64.  
  65. pascal Handle     CRMGetResource(ResType theType, short theID);
  66. pascal Handle     CRMGet1Resource(ResType theType, short theID);
  67. pascal Handle     CRMGetIndResource(ResType theType, short index);
  68. pascal Handle     CRMGet1IndResource(ResType theType, short index);
  69. pascal Handle     CRMGetNamedResource(ResType theType, const Str255 name);
  70. pascal Handle     CRMGet1NamedResource(ResType theType, const Str255 name);
  71. pascal void         CRMReleaseResource(Handle theHandle);
  72. pascal Handle     CRMGetToolResource (short procID, ResType theType, short theID);
  73. pascal void       CRMReleaseToolResource (short procID, Handle theHandle);
  74.  
  75. pascal long         CRMGetIndex(Handle theHandle);
  76.  
  77. pascal short     CRMLocalToRealID(ResType bundleType, short toolID, ResType theKind, short localID);
  78. pascal short     CRMRealToLocalID(ResType bundleType, short toolID, ResType theKind, short realID);
  79.  
  80. pascal OSErr        CRMGetIndToolName(OSType bundleType, short index, Str255 toolName);
  81.  
  82. pascal OSErr     CRMFindCommunications(short *vRefNum, long *dirID);
  83.  
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87.  
  88. #endif __COMMRESOURCES__